package cn.supermaster.management.schedule.service.impl;

import cn.supermaster.management.common.text.Convert;
import cn.supermaster.management.schedule.domain.ScheduleTaskLog;
import cn.supermaster.management.schedule.mapper.ScheduleTaskLogMapper;
import cn.supermaster.management.schedule.service.IScheduleTaskLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * All rights Reserved, Designed By www.super-bytecode.com
 *
 * @ProjectName: supermaster-management
 * @Package: cn.supermaster.management.task.service.impl
 * @ClassName: TaskScheduleLogServiceImpl11
 * @Description: [定时任务调度日誌信息信息 服务层]
 * <p> </p>
 * @Author: [Lance Ting]
 * @Date: 2021/1/12 12:31
 * @Version: V1.0
 * @Copyright: 2021 www.super-bytecode.com Inc. All rights reserved.
 * TODO: 注意,本文件Lance Ting所作,如果转载或使用请标明具体出处!
 **/
@Service
public class ScheduleTaskLogServiceImpl implements IScheduleTaskLogService {
    
    @Autowired
    private ScheduleTaskLogMapper scheduleTaskLogMapper;

    /**
     * @Description: [获取quartz调度器日志的计划任务]
     * <p></P>
     * @Title: selectJobLogList
     * @Author: Lance Ting
     * @Date: 2021-01-28
     * @Param: jobLog  调度日志信息
     * @Return: java.util.List<cn.supermaster.management.schedule.domain.ScheduleTaskLog> 调度任务日志集合
     * @Throws: 
     */
    @Override
    public List<ScheduleTaskLog> selectJobLogList(ScheduleTaskLog jobLog) {
        return scheduleTaskLogMapper.selectJobLogList(jobLog);
    }

    /**
     * @Description: [通过调度任务日志ID查询调度信息]
     * <p></P>
     * @Title: selectJobLogById
     * @Author: Lance Ting
     * @Date: 2021-01-28
     * @Param: jobLogId 调度任务日志ID
     * @Return: cn.supermaster.management.schedule.domain.ScheduleTaskLog 调度任务日志对象信息
     * @Throws: 
     */
    @Override
    public ScheduleTaskLog selectJobLogById(Long jobLogId) {
        return scheduleTaskLogMapper.selectJobLogById(jobLogId);
    }

    /**
     * @Description: [新增任务日志]
     * <p></P>
     * @Title: addJobLog
     * @Author: Lance Ting
     * @Date: 2021-01-28
     * @Param: jobLog  调度日志信息
     * @Return: void
     */
    @Override
    public void addJobLog(ScheduleTaskLog jobLog) {
        scheduleTaskLogMapper.insertJobLog(jobLog);
    }

    /**
     * @Description: [批量删除调度日志信息]
     * <p></P>
     * @Title: deleteJobLogByIds
     * @Author: Lance Ting
     * @Date: 2021-01-28
     * @Param: ids 需要删除的数据ID
     * @Return: int
     */
    @Override
    public int deleteJobLogByIds(String ids) {
        return scheduleTaskLogMapper.deleteJobLogByIds(Convert.toStrArray(ids));
    }


    /**
     * @Description: [删除任务日志]
     * <p></P>
     * @Title: deleteJobLogById
     * @Author: Lance Ting
     * @Date: 2021-01-28
     * @Param: jobId 调度日志ID
     * @Return: int
     */
    @Override
    public int deleteJobLogById(Long jobId) {
        return scheduleTaskLogMapper.deleteJobLogById(jobId);
    }

    /**
     * @Description: [清空任务日志]
     * <p></P>
     * @Title: cleanJobLog
     * @Author: Lance Ting
     * @Date: 2021-01-28
     * @Return: void
     */
    @Override
    public void cleanJobLog() {
        scheduleTaskLogMapper.cleanJobLog();
    }
}
